import request from '@/utils/request'
/*/**
 * @description:查询列表接口
 * @param {type} query:查询条件对象,current:当前页码,size:展示几条数据
 * @return: promise
 */
export function ApiGetList(query, current = 1, size = 20) {
  return request({
    url: `/article/category/search`,
    method: 'post',
    data: {
      ...query,
      current,
      size
    }
  })
}
/*/**
 * @description:新增类别接口
 * @param {type} data提交数据
 * @return: promise
 */
export function ApiAdd(data) {
  return request({
    url: `/article/category`,
    method: 'post',
    data
  })
}
/*/**
 * @description:查询类别详情接口
 * @param {type} id:查询id
 * @return: promise
 */
export function ApiById(id) {
  return request({
    url: `/article/category/${id}`,
    method: 'get'
  })
}
/*/**
 * @description:修改类别详情接口
 * @param {type} id:查询id
 * @return: promise
 */
export function ApiSetId() {
  return request({
    url: `/article/category`,
    method: 'put'
  })
}
/*/**
 * @description:删除类别详情接口
 * @param {type} id:删除id
 * @return: promise
 */
export function ApiDelId(id) {
  return request({
    url: `/article/category/${id}`,
    method: 'delete'
  })
}
/*/**
 * @description:获取所有正常分类标签
 * @param {type} 无
 * @return: promise
 */
export function ApiGetCategoryAndLabel() {
  return request({
    url: `/article/category/label/list`,
    method: 'get'
  })
}
